import Vue from 'vue'
import defaultHeaderImg from '../assets/img/user_img.png';
const bus = new Vue({
    data(){
        return{
          BusUserInfo:{
            user:'',
            userName:'',
            userImg:defaultHeaderImg,
            birthday:"",
            addresss:[]
          }
        }
    },
    created(){
        //绑定监听
        this.$on('updateData',(key,val) => {
          console.log("bus update");
          console.log(key + val);
            this.BusUserInfo[key] = val;
        }),
        this.$on('updateAll',(val) => {
            console.log("bus updateAll");
              this.BusUserInfo = val;
              console.log(this.BusUserInfo);
              
          });
    }
})


export default bus;
